// 包含多个请求函数接口的的模块
import ajax from './ajax'

// 1、根据经纬度获取位置详情
export const reqAddress = (geohash) => ajax('/api/position/'+geohash)

// 2、获取食品分类列表
export const reqFoodList = () => ajax('/api/index_category')

// 3、根据经纬度获取商铺列表
export const reqShopList = (latitude, longitude) => ajax('/api/shops', {latitude, longitude})

// 4、获取一次性验证码
//export const reqYanma = () => ajax('/api/captcha')

// 5、用户名密码登陆
export const pwdLogin = ({name, pwd, captcha}) => ajax('/api/login_pwd', {name, pwd, captcha}, 'POST')

// 6、发送短信验证码
export const sendcode = (phone) => ajax('/api/sendcode' ,{phone})

// 7、手机号验证码登陆
export const smsLogin = ({phone, code}) => ajax('/api/login_sms', {phone, code}, "POST")

// 8、根据会话获取用户信息
export const reqMessage = () => ajax('/api/userinfo')

export const reqShopGoods = () => ajax('/goods')
export const reqShopRatings = () => ajax('/ratings')
export const reqShopInfo = () => ajax('/info')
